<?php
/**
 * @package			ALM Autos
 * @version			$Id: view.html.php 10 2012-02-13 12:20:22Z netix.mail@gmail.com $
 * @subpackage		com_almautos
 * @autor			ALM Studio
 * @copyright		Copyrights ALM Studio 2011. All rights reserved
 * @autor url		http://alm-studio.net
 * @autor email		info@almstudio.net
 */
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class ALMAutosViewCategories extends JView
{	
	protected $items;
	protected $pagination;
	protected $state;
	protected $form;
	
	function display($tpl = null) 
	{	
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');
		
		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}
	
		$this->addToolBar();
		parent::display($tpl);
	}

	protected function addToolBar() 
	{
		JToolBarHelper::title(JText::_('COM_ALMAUTOS_CATEGORIES_MENAGER'), 'categories');
		JToolBarHelper::divider();
		JToolBarHelper::editListX('category.edit', 'COM_ALMAUTOS_TOOLBAR_EDIT');
		JToolBarHelper::addNewX('category.add', 'COM_ALMAUTOS_TOOLBAR_ADD');
		JToolBarHelper::deleteList('', 'categories.delete', 'COM_ALMAUTOS_TOOLBAR_DELETE');
	}

}
